﻿using System;
using System.Collections.Generic;
using System.Text;

using efish.Framework.Model;

namespace efish.Framework.Dao
{
    public class MembersDAO : BaseDAO<Member>
    {

        public Member GetMember(string email, string pwd)
        {
            string[] parames = { "Email", "Password" };
            string[] values = { email, pwd };

            IList<Member> list = this.FindByNamedQueryAndNamedParam<Member>(
                "GetMemberByEmailAndPwd", parames, values);

            if (list.Count > 0)
            {
                return list[0];
            }
            else
            {
                return null;
            }
        }
        public Member GetMember(string email)
        {
            IList<Member> list = this.FindByNamedQueryAndNamedParam<Member>("GetMemberByEmail", "Email", email);

            if (list.Count > 0)
            {
                return list[0];
            }
            else
            {
                return null;
            }
        }
    }
}
